home *** CD-ROM | disk | FTP | other *** search
/ CD World Haziran 1997 / CD World Haziran 1997.iso / Explorer Yardimcilari / PiXCL Tools / Bandit.px_ / Bandit.px
Encoding:
PiXCL source  |  1996-08-14  |  3.1 KB  |  129 lines

  1. Initialize:
  2.     SetColorPalette(GENERATE)
  3.     WinGetActive(Win$)
  4.     UseCoordinates(PIXEL)
  5.     UseBackGround(TRANSPARENT,192,192,192)
  6.     DrawBackGround
  7.     SetMouse(0,0,300,200,Test,X,Y)
  8.     WaitInput(100)  {let NT and 95 catch up}
  9.     WinLocate(Win$,100,100,520,360,Res)
  10.     Title$ = "Slot Machine Example"
  11.     WinTitle(Win$, Title$)
  12.  
  13.  
  14.     InfoMenu(REMOVE)
  15.     WaitInput(100)
  16.     SetMenu("Exit!",Leave,
  17.         ENDPOPUP,
  18.         "Play",Test,
  19.         ENDPOPUP)
  20.     
  21.     Button(100,150,200,180,"Play",Test)
  22.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  23.     DrawShadeRectangle(cx1,cy1,cx2,cy2, 0,0,0, 0,0,255, TOPBOTTOM)
  24.     GoSub DrawSlotWindows
  25.  
  26. Wait_for_Input:
  27.     WaitInput()
  28.  
  29.  
  30. Leave:
  31.     End
  32.  
  33. Test:
  34.     GoSub DrawSlotWindows
  35.     SpinNumber = 5
  36.     Random(14,Result)
  37.     ix1 = 20   ix2 = 10
  38.     While SpinNumber <> 0
  39.         GoSub Spin
  40.         SpinNumber--
  41.     EndWhile
  42.     GoSub StopSpin
  43.         WaitInput(100)
  44.  
  45.     SpinNumber = 5
  46.     Random(14,Result)
  47.     ix1 = 120   ix2 = 10
  48.     While SpinNumber <> 0
  49.         GoSub Spin
  50.         SpinNumber--
  51.     EndWhile
  52.     GoSub StopSpin
  53.         WaitInput(100)
  54.  
  55.     SpinNumber = 5
  56.     Random(14,Result)
  57.     ix1 = 220   ix2 = 10
  58.     While SpinNumber <> 0
  59.         GoSub Spin
  60.         SpinNumber--
  61.     EndWhile
  62.     GoSub StopSpin
  63.         WaitInput(100)
  64.  
  65.     SpinNumber = 5
  66.     Random(14,Result)
  67.     ix1 = 320   ix2 = 10
  68.     While SpinNumber <> 0
  69.         GoSub Spin
  70.         SpinNumber--
  71.     EndWhile
  72.     GoSub StopSpin
  73.  
  74.  
  75.     
  76.     Goto Wait_for_Input
  77.  
  78. {======================================================================}
  79. Spin:
  80.     DrawIcon(ix1,ix2,64,64,ICON01)
  81.     DrawIcon(ix1,ix2,64,64,ICON02)
  82.     DrawIcon(ix1,ix2,64,64,ICON03)
  83.     DrawIcon(ix1,ix2,64,64,ICON04)
  84.     DrawIcon(ix1,ix2,64,64,ICON05)
  85.     DrawIcon(ix1,ix2,64,64,ICON06)
  86.     DrawIcon(ix1,ix2,64,64,ICON07)
  87.     DrawIcon(ix1,ix2,64,64,ICON08)
  88.     DrawIcon(ix1,ix2,64,64,ICON09)
  89.     DrawIcon(ix1,ix2,64,64,ICON10)
  90.     DrawIcon(ix1,ix2,64,64,ICON11)
  91.     DrawIcon(ix1,ix2,64,64,ICON12)
  92.     DrawIcon(ix1,ix2,64,64,ICON13)
  93.     DrawIcon(ix1,ix2,64,64,ICON14)
  94.     Return
  95.  
  96. StopSpin:
  97.     If Result = 1 Then DrawIcon(ix1,ix2,64,64,ICON01)
  98.     If Result = 2 Then DrawIcon(ix1,ix2,64,64,ICON02)
  99.     If Result = 3 Then DrawIcon(ix1,ix2,64,64,ICON03)
  100.     If Result = 4 Then DrawIcon(ix1,ix2,64,64,ICON04)
  101.     If Result = 5 Then DrawIcon(ix1,ix2,64,64,ICON05)
  102.     If Result = 6 Then DrawIcon(ix1,ix2,64,64,ICON06)
  103.     If Result = 7 Then DrawIcon(ix1,ix2,64,64,ICON07)
  104.     If Result = 8 Then DrawIcon(ix1,ix2,64,64,ICON08)
  105.     If Result = 9 Then DrawIcon(ix1,ix2,64,64,ICON09)
  106.     If Result = 10 Then DrawIcon(ix1,ix2,64,64,ICON10)
  107.     If Result = 11 Then DrawIcon(ix1,ix2,64,64,ICON11)
  108.     If Result = 12 Then DrawIcon(ix1,ix2,64,64,ICON12)
  109.     If Result = 13 Then DrawIcon(ix1,ix2,64,64,ICON13)
  110.     If Result = 14 Then DrawIcon(ix1,ix2,64,64,ICON14)
  111.     Return
  112.  
  113.  
  114. DrawSlotWindows:
  115.     UsePen(SOLID,1,0,255,255)
  116.     UseBrush(SOLID,255,255,255)
  117.     DrawRectangle( 20,10, 84,74)
  118.     DrawRectangle(120,10,184,74)
  119.     DrawRectangle(220,10,284,74)
  120.     DrawRectangle(320,10,384,74)
  121.     
  122.     UseFont("Arial",7,15,NOBOLD,NOITALIC,NOUNDERLINE,255,255,255)
  123.     DrawText(20,90,"Odds of all the same icons are 38,416 : 1")
  124.     DrawText(20,105,"Odds of three icons the same are 2,955 : 1")
  125.     DrawText(20,120,"Odds of two icons the same are 227 : 1")
  126.  
  127.     Return
  128.  
  129.